﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Xunit;
using YAPL.Language.SourceParser;
using YAPL.Language.Ast;
using YAPL.Language.SourceParser.XML;

namespace YAPL.Test.YAPL.Language.Parser.XML.NodeParsers {
	public class XmlCodeBlockParserTest : XmlNodeParserTest {

		[Fact]
		public void EmptyBlockShouldBeParsedCorrectly() {
			var emptyBlockNode = new XElement(XmlNames.CodeBlockExpression);
			var expr = _parser.ParseNode(emptyBlockNode);
			Assert.IsType(typeof(CodeBlockExpression), expr);
			var codeBlock = (CodeBlockExpression) expr;
			Assert.Empty(codeBlock.Expressions);
		}
	}
}